/*
 * ScrollPaneDelegate.h  0.4.0 / Dec 05, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#ifndef SCROLLPANEDELEGATE_H
#define SCROLLPANEDELEGATE_H

#include "Cute4jSwing.h"

#include "ComponentDelegate.h"

// ScrollPaneDelegate Class. ---------------------------------------------------

/*!
 * \brief ScrollPane Delegate.
 *
 * \author Slobodan Vrkacevic
 * \version 0.4.0
 */
class CUTE4J_EXPORT ScrollPaneDelegate : public ComponentDelegate
{
  Q_OBJECT
protected:
  ScrollPaneDelegate(JNIEnv *env, jobject obj);
public slots: // native calls
  void setView(JNIEnv *env, jlong viewDelegate);
public: // native calls
  static jlong newInstance(JNIEnv *env, jobject obj);
protected:
  virtual bool filterResizeEvent(QObject *obj, QResizeEvent *e);
public:
  inline QScrollArea *qScrollArea() const;
private:
  ComponentDelegate *m_viewDelegate;
};

// ScrollPaneDelegate :: Public Inline Member Function. ------------------------

/*!
 * \brief Returns QScrollArea adaptee.
 *
 * \return QScrollArea adaptee
 */
inline QScrollArea *ScrollPaneDelegate::qScrollArea() const
{
  return static_cast<QScrollArea *>(qObject());
}

// Macro Definition. -----------------------------------------------------------

#define SCROLL_PANE_DELEGATE (reinterpret_cast<ScrollPaneDelegate *>(delegate))

#endif // SCROLLPANEDELEGATE_H
